// 发布
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import './plugins/element.js'
/* 导入全局样式表 */
import './assets/css/global.css'
// 导入nprogress
import Nprogress from 'nprogress'
Vue.use(Nprogress)
// 导入axios
import axios from 'axios'

// 配置请求根路径
axios.defaults.baseURL = ''

axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

axios.interceptors.response.use(config => {
  return config
})
// 将axios挂载到vue 命名为$http
Vue.prototype.$http = axios

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
